<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <#include "../common/include_easyui.ftl">
    <#assign ctx = request.contextPath>

    <script type="text/javascript">
        var ctxPath = "${ctx}";

        function saveData() {

            var isValid = jQuery("#modifyForm").form('validate');
            if (!isValid) {
                jQuery("#modifyForm").form('enableValidation');
            } else {

                var saveURL = ctxPath + "/dataDictionaryMgrController/modifyDict?date=" + new Date() + "";
                var paramObj = jQuery("#modifyForm").serializeArray();

                //alert(jQuery("#modifyForm").serialize())

                jQuery.post(saveURL, paramObj, function (responseData) {

                    var code = responseData.code;

                    if (code == "200") {
                        $.messager.alert('我的消息', '数据字典信息修改成功！', 'info', function () {
                            var parentWin = window.parent;
                            parentWin.jQuery("#div_table").datagrid("reload");
                            parentWin.jQuery('#dialog_div').dialog("close");
                        });

                    } else {
                        $.messager.alert('我的消息', "数据保存出错，原因 ：" + responseData.message, 'error');
                    }
                }, "json");
            }
        }
    </script>

    <style type="text/css">

        .modify-form div {
            margin-bottom: 20px;
            /* 	display: flex;
                justify-content:center; */
        }

        .modify-form div input {
            max-width: 400px;
            height: 28px;
            width: 100%;
        }
    </style>
</head>

<body>
<form id="modifyForm" method="post" class="modify-form">
    <div style="padding-left:12%;margin-top:20px;width: 80%;">
        <input class="easyui-textbox" name="id" value="${dict.id?c}" readonly="true" labelAlign="right" data-options="label:'ID：',required:true" />
    </div>
    <div style="padding-left:12%;width: 80%;">
        <input class="easyui-textbox" name="type" value="${dict.type}" labelAlign="right" data-options="label:'类别：',required:true" />
    </div>
    <div style="padding-left:12%;width: 80%;">
        <input class="easyui-textbox" name="item" value="${dict.item}" labelAlign="right" data-options="label:'条目：',required:true" />
    </div>
    <div style="padding-left:12%;width: 80%;">
        <input class="easyui-textbox" name="value" value="${dict.value}" labelAlign="right" data-options="label:'值：',required:true" />
    </div>
</form>

</body>
</html>
